﻿using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB;

namespace YJKAreaStatistic.Utils
{
	internal class FilterElementByClass
	{
		public static List<T> GetElemByClassWithView<T>(Autodesk.Revit.DB.View view)
		{
			return new FilteredElementCollector(view.Document, view.Id).OfClass(typeof(T)).Cast<T>().ToList<T>();
		}

		public static List<T> GetElemByClassWithDocument<T>(Autodesk.Revit.DB.Document doc)
		{
			return new FilteredElementCollector(doc).OfClass(typeof(T)).Cast<T>().ToList<T>();
		}
	}
}
